package com.crm.model.vo.customerContractManager;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yincuimei
 * @Date 2021/3/12 11:44
 */
@Data
public class CustomerContractVO {
    //合同ID
    private String contractId;

    //订单ID
    private String orderId;

    //合同编号
    private String contractNumber;

    //订单编号
    private String orderNumber;

    //支付方式
    private String paymentMethod;

    //客户id
    private String customerId;

    //客户名称
    private String customerName;

    //联系人id
    private String contactId;

    //联系人
    private String contactName;

    //联系方式
    private String contactDetails;

    //客户邮箱
    private String customerEmail;

    //合同类型
    private String contractType;

    //合同状态
    private String contractStatus;

    //创建时间
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
    private Date createTm;

    //合同开始日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractStartDate;

    //合同结束日期
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date contractEndDate;

    //是否是会员合同--(1-是；0-否)
    private String whetherCheck;

    //更新人
    private String updatePeopleName;

    //更新时间
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date updateTm;

    //合同审批状态(1-审批;0-未审批)
    private String contractApprovalStatus;

    //合同审核状态(合同审核状态：0-未审核；1-审核中；2-审核通过；3-审核失败 （审核维护）)
    private String contractReviewStatus;

    //创建人(所属人)
    private String createPeopleName;

    //所属分公司
    private String companyName;

    //合同总金额
    private BigDecimal contractTotalAmount;

    //合同优惠总金额
    private BigDecimal contractDiscountTotalAmount;

    //合同实际总金额
    private BigDecimal contractActualTotalAmount;

    //合同应收款
    private BigDecimal contractReceivables;

    //合同总回款金额
    private BigDecimal contractTotalPaymentAmount;

    //审核人id
    private String reviewerId;

    //审核人
    private String reviewerName;

    //审核时间
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date reviewTime;

    //回款状态(0-未回款；1-已回款；3-部分回款)
    private String paymentStatus;

    //付款账号
    private String paymentAccount;

    //是否保密
    private String whetherKeepSecret;

    //提成发放状态(1:已全部发放；2:部分发放;3:未发放)
    private String commissionStatus;

    //普通产品最高会员级别
    private Integer productMembershipLevel;

    //活动产品最高会员级别
    private Integer vipProductMembershipLevel;

    //1-补款升级合同；2-兑换合同
    private String contractOtherType;

    //合同备注
    private String contractReviewNotes;

    //是否是老合同：0:否;1:是2:添补合同
    private String oldContract;

    //删除状态--0:正常；1：已删除
    private String deleteStatus;

    //附件id
    private String ContractAnnexId;

    //支付方式
    private String paymentMethodText;

    public String getPaymentMethodText(){
        String paymentMethodText = "";
        if (!StringUtils.isBlank(paymentMethod)) {
            switch (paymentMethod) {
                case "2":
                    paymentMethodText = "线下支付";
                    break;
                case "3":
                    paymentMethodText = "余额支付";
                    break;
                case "4":
                    paymentMethodText = "转入额支付";
                    break;
                case "5":
                    paymentMethodText = "余额＋转入额支付";
                    break;
                case "6":
                    paymentMethodText = "微信支付";
                    break;
                default :
            }
        }
        return paymentMethodText;
    }
}
